﻿package game.network.api.fb.data {

	public class FacebookAuthResponse {

		public var uid:String;
		public var expireDate:Date;
		public var accessToken:String;
		public var signedRequest:String;

		public function FacebookAuthResponse () {

		}

		public function fromJSON (result:Object):void {
			if (result != null) {
				expireDate = new Date();
				expireDate.setTime (expireDate.time + result.expiresIn * 1000);
				accessToken = result.access_token || result.accessToken;
				signedRequest = result.signedRequest;
				uid = result.userID;
			}
		}

		public function toString ():String {
			return '[userId:' + uid + ']';
		}
	}
}